#ifndef SPELLCHECKER_H
#define SPELLCHECKER_H

#include <QDialog>
#include <QHash>
#include <QStringList>

#include "ortho.h"


namespace Ui {
class SpellChecker;
}

class SpellChecker : public QDialog
{
		Q_OBJECT

	private:
		Ui::SpellChecker *ui;
		QString m_text;

		int m_badIndex;
		void loadLanguages();

		Ortho* m_ortho;


	private slots:
		void onReplaceAllClicked ();
		void onUnknownComboIndexChanged (QString newWord);
		void onLanguagesCurrentIndexChange (QString lang);
		void onWordEditTextChanged (QString newWord);
		void onSuggestListCurrentTextChanged (QString);
		void updateDialog();

	public:
		explicit SpellChecker(QWidget *parent = 0);
		~SpellChecker();

	public slots:
		int run (const QString& text);

	signals:
		void replace (QString bad, QString good);
		void replaceAll (QString bad, QString good);
		void ignore (QString bad);
		void addToDic (QString bad);

};

#endif // SPELLCHECKER_H
